/**
 * Module dependencies.
 */
var mongoose = require('mongoose');
var config = require('../config/config').config;

mongoose.connect(config.db, function (err) {
    if (err) {
        console.error('connect to %s error: ', config.db, err.message);
        process.exit(1);
    }
});

// models
require('./user');
require('./soft');
require('./tag');
require('./soft_tag');
require('./notify');

exports.User = mongoose.model('User');
exports.Soft = mongoose.model('Soft');
exports.Tag = mongoose.model('Tag');
exports.SoftTag = mongoose.model('SoftTag');
exports.Notify = mongoose.model('Notify');